package com.xwh.week1;

public class Practice7 {
    public static void main(String[] args) {
        System.out.println(method());
    }

    public static int method() {
        // int res = false;
        int sum = 0;
        int i = 2;

        while(true) {
            if (method2(i)) {
                ++sum;
            }

            if (sum == 10001) {
                return i;
            }

            ++i;
        }
    }

    public static boolean method2(int num) {
        int flag = 1;
        int j = (int)Math.sqrt((double)num);

        for(int i = 2; flag != 0 && i <= j; ++i) {
            flag = num % i;
        }

        return flag != 0;
    }
}
